
////////////////////////////////////////////////////////
// 
//	AREA ADMINISTRATION
//
////////////////////////////////////////////////////////

$(document).ready(function() {
	$('#listSubmenuLancher').click (function(){
		$('#listSubmenuContainer').toggle();
	});
	
	$('.list_submenu_item').click(function() {
		$('#listSubmenuContainer').hide();
	});
})


function openAreaDialog() {
	$.ajax({
		url:	'../province/viewProvince?set_ajax_view',		
		beforeSend: function() {
			$('#ajaxLoader').show();
		},
		complete: function() {
			$('#ajaxLoader').hide();
		},
		dataType: 	'html',
		success: function(data) {
			$('#listSubmenuDialog').html(data);
			var buttons = {};
			buttons[_('Close')] = function() {		
				$(this).dialog('close');		
			};
			
			generalDialog('listSubmenuDialog', _('Area list'), null, null, {
				autoOpen: true,			
				bgiframe: true,
				resizable: false,		
				width: 700,
				height: 500,
				modal: true,
				buttons: buttons
			});
		}
	});	
}


function openMedicineDialog() {
	$.ajax({
		url:	'../Medicine/Management?set_ajax_view',		
		beforeSend: function() {
			$('#ajaxLoader').show();
		},
		complete: function() {
			$('#ajaxLoader').hide();
		},
		dataType: 	'html',
		success: function(data) {
			$('#listSubmenuDialog').html(data);
			var buttons = {};
			buttons[_('Close')] = function() {		
				$(this).dialog('close');		
			};
			
			generalDialog('listSubmenuDialog',_('Medicine list'),null,null,{
				autoOpen: true,			
				bgiframe: true,
				resizable: false,		
				width: 800,
				height: 500,
				modal: true,
				buttons: buttons
			});
		}
	});	
}

function openEmployeeDialog() {
	$.ajax({
		url:	'../HumanResources/Manage?set_ajax_view',		
		beforeSend: function() {
			$('#ajaxLoader').show();
		},
		complete: function() {
			$('#ajaxLoader').hide();
		},
		dataType: 	'html',
		success: function(data) {
			$('#listSubmenuDialog').html(data);
			var buttons = {};
			buttons[_('Close')] = function() {		
				$(this).dialog('close');		
			};
			
			generalDialog('listSubmenuDialog', _('Employee list'),null,null,{
				autoOpen: true,			
				bgiframe: true,
				resizable: false,		
				width: 830,
				height: 500,
				modal: true,
				buttons: buttons
			});
		}
	});	
}